import { _axios } from '@/utils/request'
// 获取角色信息
export const sysrole = (params) => {
  return _axios({
    url: '/sys/role',
    params
  })
}
// 获取公司信息
export const company = (id) => {
  return _axios({
    url: `/company/${id}`
  })
}
// 保存角色信息
export const sysrolePost = (data) => {
  return _axios({
    url: '/sys/role',
    method: 'POST',
    data
  })
}
// 删除用户
export const sysroleDelete = (id) => {
  return _axios({
    url: `/sys/role/${id}`,
    method: 'DELETE'
  })
}
// 修改角色信息
export const sysrolePut = (data) => {
  return _axios({
    url: `/sys/role/${data.id}`,
    method: 'PUT',
    data
  })
}
// 获取角色详情
export const sysroleGet = (id) => {
  return _axios({
    url: `/sys/role/${id}`,
    method: 'get'
  })
}
// 给角色分配权限
export const sysroleassignPrem = (data) => {
  return _axios({
    url: '/sys/role/assignPrem',
    method: 'put',
    data
  })
}
// 更新权限
export const sysroleassignPremPUT = (data) => {
  return _axios({
    url: `/sys/role/assignPrem`,
    method: 'put',
    data
  })
}
